<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/common.jsp"%>


<html lang="en">
<head>
	<link href="${prcs}/css/def/ztree/metro.css" rel="stylesheet">
    <link href="${prcs}/css/def/jquery/plugin/treeTable/themes/vsStyle/treeTable.min.css" rel="stylesheet">
    <link href="${prcs}/css/def/bootstrap/ace/ace-part2.min.css" rel="stylesheet">
    <link href="${prcs}/css/def/bootstrap/ace/ace.css" rel="stylesheet">
    <link href="${prcs}/css/def/bootstrap/ace/ace-ie.min.css" rel="stylesheet">
    <link href="${prcs}/css/def/frm/common/common.css" rel="stylesheet">
<%--     <link href="${prcs}/css/def/frm/sys/sysPermission.css" rel="stylesheet"> --%>
    <script src="${prcs}/js/jquery/plugin/jquery.ztree.all-3.5.min.js"></script>
    <script src="${prcs}/js/jquery/plugin/treeTable/jquery.treeTable.js"></script>
	<script type="text/javascript">
		var zNodes = ${treeArray};
	</script>
<style>
	.ma_content{
		position:relative;
	}
	.ma_mark{
		position:absolute;
		top:6px;
		right:0;
		color:red;
		font-size:20px;
	}
	.bottom .dataTables_info{
		float:left;
	}
	.bottom .dataTables_paginate{
		float:right;
	}
	table td {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		/* text-align: center; */
		font-size: 13px !important;
	}
	table th {
		text-align: center;
		font-size: 13px !important;
	}
</style>
</head>
<body>
	<div class="head-title">
		<span>权限管理</span>
	</div>
<div class="container-fluid" id="PermissionHeader">
    <div class="row-fluid">
        <!-- 机构树面板 -->
        <div class="row top-row">
            <div class="col-sm-4" id="daiban">
            <!-- Default panel contents -->
                <div class="upfpanel-menu" style="height:40px; font-size:18px;">
                    <a href="#" class="my-icon-a" title="全部展开" onclick="expandAll();"> <span
                            class="glyphicon glyphicon-plus my-icon" aria-hidden="true"></span>
                    </a>
                    <a href="#" class="my-icon-a" title="全部折叠" onclick="collapseAll();"> <span
                            class="glyphicon glyphicon-minus my-icon" aria-hidden="true"></span>
                    </a>
                    <shiro:hasPermission name="sys:perm:refresh">
                        <a href="#" class="my-icon-a" title="刷新" onclick="refreshTree();"> <span
                                class="glyphicon glyphicon-refresh my-icon" aria-hidden="true"></span>
                        </a>
                    </shiro:hasPermission>
                    <shiro:hasPermission name="sys:perm:search">
                        <a href="#" class="my-icon-a" title="列表" onclick="showlist();"> <span
                                class="glyphicon glyphicon-th-list my-icon" aria-hidden="true"></span>
                        </a>
                    </shiro:hasPermission>
                </div>
                <div class="menuTreeCan">
                        <ul id="tree" class="ztree" style="overflow:none;"></ul>
                </div>
            <!-- List group -->
            </div>
            <div class="col-sm-1"><div style="width:1px; border-left:1px solid #ccc"></div></div>
            <div class="col-sm-7">
                <!-- Default panel contents -->
                <div id="ctrlDom">
                    <shiro:hasPermission name="sys:perm:add">
                        <button class="btn btn-info" id="addDom" onclick="addPermission();"><span
                                class="glyphicon glyphicon-plus"></span> 插入节点
                        </button>
                    </shiro:hasPermission>
                    <shiro:hasPermission name="sys:perm:delete">
                        <button class="btn btn-danger" onclick="delPermission();"><span
                                class="glyphicon glyphicon-minus"></span> 删除节点
                        </button>
                    </shiro:hasPermission>
                    <shiro:hasPermission name="sys:perm:update">
                        <button class="btn btn-info" onclick="showUpdate();"><span
                                class="glyphicon glyphicon-pencil"></span> 修改节点
                        </button>
                    </shiro:hasPermission>
                    <shiro:hasPermission name="sys:perm:searchStaff">
                        <button type="button" class="btn btn-info" onclick="showStaff();"><span
                                class="glyphicon glyphicon-user"></span> 查看人岗
                        </button>
                    </shiro:hasPermission>
                    <!-- <button class="btn btn-warning btn-block"><span class="glyphicon glyphicon-arrow-up"></span> 向上移动</button>
                    <button class="btn btn-warning btn-block"><span class="glyphicon glyphicon-arrow-down"></span> 向下移动</button>
                    <button class="btn btn-danger btn-block"><span class="glyphicon glyphicon-export"></span> 提高层级</button>
                    <button class="btn btn-danger btn-block"><span class="glyphicon glyphicon-import"></span> 降低层级</button> -->
                </div>
                <!-- List group -->
                <div>
                    <div>
                        <!-- end of upfpanel-header -->
                        <div style="height:380px;">
                            <div id="permissionShow"  name="permissionShow">
                                <form class="form-horizontal">
                                    <div class="input-group" style="margin:25px 20px 30px 0px;">
                                        <span class="input-group-addon" for="sysPermissionCode" basic-addon1"="">权限编码</span>
                                        <div class="form-control"><span id="sysPermissionCode">${map.PERM_CODE}</span></div>
                                    </div>
                                    
                                    <div class="input-group" style="margin:30px 20px 30px 0px;">
                                        <label for="sysPermissionName" class="input-group-addon">权限名称</label>
                                        <div class="form-control" id="sysPermissionName">${map.PERM_NAME}</div>
                                    </div>
                                    <div class="input-group" style="margin:30px 20px 30px 0px;">
                                        <label for="sysPermissionUri" class="input-group-addon" >权限URI</label>
                                        <div class="form-control" id="sysPermissionUri">${map.URI}</div>
                                    </div>
                                    <div class="input-group" style="margin:30px 20px 30px 0px;">
                                        <label for="sysPermissionType" class="input-group-addon" >权限类型</label>
                                        <div class="form-control" id="sysPermissionType">${map.PERM_TYPE}</div>
                                    </div>
                                    <div class="input-group" style="margin:30px 20px 30px 0px;">
                                        <label for="sysPermissionIcon" class="input-group-addon" >菜单图标</label>
                                        <div class="form-control" id="sysPermissionIcon">${map.PERM_ICON}</div>
                                    </div>
                                    <div class="input-group" style="margin:30px 20px 30px 0px;">
                                        <label for="sysPermissionCheck" class="input-group-addon" >校验字符</label>
                                        <div class="form-control" id="sysPermissionCheck">${map.PERM_CHECK}</div>
                                    </div>
                                    <div class="input-group" style="margin:30px 20px 30px 0px;">
                                        <label for="sysPermissionSort" class="input-group-addon" >展示顺序</label>
                                        <div class="form-control" id="sysPermissionSort">${map.PERM_SORT}</div>
                                    </div>
                                    <div class="input-group" style="margin:30px 20px 30px 0px;">
                                        <label  class="input-group-addon" >数据权限</label>
                                        <div class="form-control" id="sysPermissionDP"></div>
                                    </div>
                                    <!-- <div class="form-group">
                                        <label for="sysPermissionGrade" class="col-sm-3 control-label" >组织级别:</label>
                                        <div class="col-sm-7">
                                            <div id="sysPermissionGrade">组织级别</div>

                                        </div>
                                    </div> -->
                                <input type="hidden" id="FirstNode" name="FirstNode" value="${map.PERM_ID}" >
                                </form>
                            </div>
                            <div id="menuInfoWell" class="content" style="display:none">
                                <form class="form-horizontal" id="permissionObj">
                                    <input type="hidden"  name="permId" >
                                    <input type="hidden" id="parentIdVal" name="parentId" >
                                    <div class="form-group" style="margin:0px">
                                    <div class="input-group" style="margin:10px 0px 10px 0px;">
                                        <label class="input-group-addon">父节点名称</label>
                                        <span class="form-control" id="parentName"></span>
                                    </div>
                                    </div>
                                    <div class="form-group" style="margin:0px">
                                    <div class="input-group" style="margin:10px 0px 10px 0px;">
                                        <label class="input-group-addon" >权限编码<span class="notNull">*</span></label>
                                        <input type="text" class="form-control" name="permCode" maxlength="20"; placeholder="权限编码" >
                                    </div>
                                    </div>
                                    <div class="form-group" style="margin:0px">
                                    <div class="input-group" style="margin:10px 0px 10px 0px;">
                                        <label class="input-group-addon">权限名称<span class="notNull">*</span></label>
                                            <input type="text" class="form-control" name="permName"  maxlength="20"; placeholder="权限名称" >
                                            
                                    </div>
                                    </div>
                                    <div class="form-group" style="margin:0px">
                                    <div class="input-group" style="margin:10px 0px 10px 0px;">
                                        <label  class="input-group-addon" >权限地址</label>
                                            <input type="text" class="form-control" name="uri" maxlength="50";  placeholder="权限地址" >
                                            <!-- <span class="ma_mark">*</span> -->
                                        
                                    </div>
                                    </div>
                                    <div class="form-group" style="margin:0px">
                                    <div class="input-group" style="margin:10px 0px 10px 0px;">
                                        <label class="input-group-addon" >权限类型</label>
                                            <!-- 1 菜单 2 标签 3 请求 -->
                                            <select class="form-control" name="permType" >
                                                <option value="1">菜单</option>
                                                <option value="2">标签</option>
                                                <option value="3">请求</option>
                                            </select>
                                    </div>
                                    </div>
                                    <div class="form-group" style="margin:0px">
                                    <div class="input-group" style="margin:10px 0px 10px 0px;">
                                        <label  class="input-group-addon" >菜单图标</label>
                                            <input type="text" class="form-control" name="permIcon" maxlength="100" placeholder="菜单图标" >
                                       
                                    </div>
                                    </div>
                                    <div class="form-group" style="margin:0px">
                                    <div class="input-group" style="margin:10px 0px 10px 0px;">
                                        <label  class="input-group-addon" >校验字符</label>
                                            <input type="text" class="form-control" name="permCheck" maxlength="60" placeholder="校验字符" >
                                            
                                    </div>
                                    </div>
                                    <div class="form-group" style="margin:0px">
                                    <div class="input-group" style="margin:10px 0px 10px 0px;">
                                        <label  class="input-group-addon" >展示顺序</label>
                                            <input type="text" class="form-control" name="permSort" maxlength="10" placeholder="展示顺序" >
                                            
                                    </div>
                                    </div>
                                     <div class="form-group" style="margin:0px">
                                    <div class="input-group" style="margin:10px 0px 10px 0px;">
				<div class="input-group" style="margin: 10px 0px 10px 0px;">
					<label class="input-group-addon">数据权限</label>
					<select class="form-control" name="dataPermissionType" id="DpType">
					</select>
				</div>
			</div>
                                    </div>
                                    <!-- <div class="form-group">
                                        <label class="col-sm-4 control-label" >组织级别:</label>
                                        <div class="col-sm-7">
                                                <select class="form-control" name="controlLevel" id="controlLevelPermissionObj" data-placeholder="选择组织级别">
                                                                <option value="-1">无限制</option>
                                                                <option value="100">集团公司</option>
                                                                <option value="200">省公司</option>
                                                                <option value="300">地市公司</option>
                                                                <option value="400">区县公司</option>
                                                            </select>
                                        </div>
                                    </div> -->
                                    <div class="form-group">
                                        <center>
                                            <!--   <a type="button" class="btn btn-default" id="dealPermission">保存</a> -->
                                            <div class="col-md-5 col-md-offset-3">
                                                <button type="submit" class="btn btn-primary" name="savebutton" id="dealPermission" onclick="ifclick()">保&nbsp&nbsp存</button>
                                            </div>
                                        </center>
                                        <div class="form-group">
                                            <center>
                                                <div class="col-md-5 col-md-offset-3">
                                                    <button type="submit" class="btn btn-primary" name="updatebutton" id="updatePermissionbtn" onclick="ifclick1()">修&nbsp&nbsp改</button>
                                                </div>
                                            </center>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
     </div>
    </div>
    <div class="container-fluid" id="PermissionContainer" style="display:none;">
    <div class="head-title">
			<h4>用户权限</h4>
		</div>
    <div class="row">
        <form class="form-inline" method="post" id="sysRoleForm">
            <div class="float-btn">
			    <a type="button"  class="btn btn-info"  id="closeAddModal" onclick="backSearch();">返&nbsp&nbsp回</a>
			</div>
        </form>
    </div>
    <hr style="margin-top: 0px;">
    <div class="row">
        <!-- 列表 -->
        <table id="searchTable" class="display table table-bordered" cellspacing="0" width="100%">
            <thead>
            <tr>
                <th>id</th>
                <th>操作</th>
                <th>人员编码</th>
                <th>人员姓名</th>
                <th>账号</th>
                <th>岗位</th>
                <th>性别</th>
                <th>电话号码</th>
                <th>邮箱账号</th>
                <th>手机号码</th>
                <th>人员状态</th>
            </tr>
            </thead>
        </table>
    </div>
</div>
    <div class="container-fluid" id="PermissionContainer2" style="display:none;">
        <div class="row">
            <form class="form-inline" method="post" id="sysRoleForm">
               <!--  <div class="head-title">
                    <h4 >权限信息</h4>
                </div> -->
              <!--   <a type="button"  class="btn btn-primary"  id="closeAddModal" onclick="backSearch();">返&nbsp&nbsp回</a> -->
            <div class="div-button col-md-pull-3">
			    <a type="button"  class="btn btn-info"  id="closeAddModal" onclick="backSearch();">返回</a>
			</div>
            </form>
        </div>
        <div class="row">
            <table id="treeTable1" class="tree_table display table table-bordered" width="100%">
                <thead>
                <tr id="root">
                    <th>编号</th>
                    <th>名称</th>
                    <th>URI</th>
                    <th>类型</th>
                    <th>图标</th>
                    <th>字符</th> 
                    <th>展示顺序</th>
                </tr>
                </thead>
                <tbody id="permissionTreeTable">
                </tbody>
            </table>
        </div>
    </div>
    <!-- 人员信息模态框 开始 -->
	<div class="modal fade" id="infoModal" tabindex="-1" role="dialog" aria-labelledby="infoModal_label">
		<div class="modal-dialog" style="min-width: 800px;">
			<div class="modal-content">
	            <div class="modal-header">
	                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
	                    <span aria-hidden="true">&times;</span>
	                </button>
	                <h4 class="modal-title">人员基本信息</h4>
	            </div>
				<div>
					<iframe id="jump_url" width="100%" height="100%" src="" style="min-height: 360px;"></iframe>
				</div>
				<div class="modal-footer">
					<button type="button"  class="btn btn-primary"  data-dismiss="modal">关闭</button>
				</div>
			</div>
		</div>
	</div>
<!-- 人员信息模态框 结束 -->
</body>
<script src="${prcs}/js/frm/sys/sysPermission.js?v=1.0"></script>
</html>

